<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        window.onload=function(){
            consolelog("文档加载结束")
        }
        window.addEventListener('load',function(){
            var div = document.querySelector('div');
            window.addEventListener('resize',function(){
                console.log('变化了');
                if (window.innerWidth <= 888){
                    div.style.display = 'none';
                }else {
                    div.style.display = 'block';

                }
            })
        })

        setTimeout(function()  {
            console.log('2秒到了');
        }, 2000)

        var i =0;
        var timer=setInterval(function(){
            console.log('1秒到了');
            i++;
            if(i>10)
            clearInterval(timer)
        },1000)


    </script>
</body>
</html>